From: Brion Vibber Date: Fri, 24 Jul 2009 20:01:23 +0000 (+0000) Subject: * (bug 19849) Custom X-Vary-Options header now disabled unless $wgUseXVO is set X-Git-Tag: 1.31.0-rc.0~40736 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=c45cfc9233b6969a7d03467ee2241be89f1b79de;p=lhc%2Fweb%2Fwiklou.git * (bug 19849) Custom X-Vary-Options header now disabled unless $wgUseXVO is set --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e389e0278b..1cf190a457 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -327,6 +327,7 @@ this. Was used when mwEmbed was going to be an extension. when using long urls * The display of the language list on the preferences is more comply with the BCP 47 standards. +* (bug 19849) Custom X-Vary-Options header now disabled unless $wgUseXVO is set == API changes in 1.16 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index f2e85dfe4c..a25af3553e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1690,6 +1690,9 @@ $wgUseSquid = false; /** If you run Squid3 with ESI support, enable this (default:false): */ $wgUseESI = false; +/** Send X-Vary-Options header for better caching (requires patched Squid) */ +$wgUseXVO = false; + /** Internal server name as known to Squid, if different */ # $wgInternalServer = 'http://yourinternal.tld:8000'; $wgInternalServer = $wgServer; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 8d80657886..93318e68c2 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -977,7 +977,7 @@ class OutputPage { } public function sendCacheControl() { - global $wgUseSquid, $wgUseESI, $wgUseETag, $wgSquidMaxage, $wgRequest; + global $wgUseSquid, $wgUseESI, $wgUseETag, $wgSquidMaxage, $wgRequest, $wgUseXVO; $response = $wgRequest->response(); if ($wgUseETag && $this->mETag) @@ -987,8 +987,10 @@ class OutputPage { # maintain different caches for logged-in users and non-logged in ones $response->header( 'Vary: Accept-Encoding, Cookie' ); - # Add an X-Vary-Options header for Squid with Wikimedia patches - $response->header( $this->getXVO() ); + if ( $wgUseXVO ) { + # Add an X-Vary-Options header for Squid with Wikimedia patches + $response->header( $this->getXVO() ); + } if( !$this->uncacheableBecauseRequestVars() && $this->mEnableClientCache ) { if( $wgUseSquid && session_id() == '' &&